package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

@Mapper
public interface OrderSettingDao {
    /*
    * 查询每天预约人数
    * */

    List<OrderSetting> select(LocalDate beng, LocalDate end);
/*
* 添加设置人数
* */
    void add(OrderSetting orderSetting);

    /*
* 根据日期查询
* */
    @Select("select * from t_ordersetting where orderDate=#{orderDate}")
    OrderSetting selectDate(Date orderDate);
/*
* 修改设置
* */
    void update(OrderSetting orderSetting);
    /*
     * 根据添加时间 想预约设置表中添加预约人数
     * */
    @Update("update t_ordersetting set reservations=reservations+1 where orderDate=#{orderDate} ")
    void updatesubNumber(Date orderDate);
}
